<template>
  <web-view :src="htmlUrl" :style="{
      height: `calc(100vh - ${navHeight}px)`,
      marginTop: `${navHeight}px`
    }"></web-view>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { onReady, onLoad } from '@dcloudio/uni-app' // 新增引入

// 假设你需要传递一个参数，设置 URL 参数
let htmlUrl = ref('http://192.168.110.112:3000/');
let navHeight = ref(0);

onLoad((options) => {
  // 计算导航栏高度（状态栏 + 胶囊按钮）
  const systemInfo = uni.getSystemInfoSync();
  const menuButton = uni.getMenuButtonBoundingClientRect();
  navHeight.value = menuButton.top + menuButton.height;
})

onMounted(async ()=>{

});
</script>

<style>
page, body, html {
  background-color: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
}
</style>
